找传奇、传世资源到传世资源站!

Lucene 搜索服务器 实例源码(ElasticSearch+Kibana)

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

using System;using System.Collections.Generic;using System.Linq;using System.Net.Sockets;using System.Text;using System.Threading;using System.Threading.Tasks;using System.Xml.Linq;using Elasticsearch;using Elasticsearch.Net;using Nest;namespace ES{ internal class Program { public static void Main(string[] args) { string result = string.Empty; ElasticSearchService searchService = new ElasticSearchService(); //清除已建索引 result = searchService.DeleteIndex(); Console.WriteLine(result); //创建索引 result = searchService.CreateIndex(); Console.WriteLine(result); //添加数据 var doctorList = searchService.BuiDoctorEntities(); result = searchService.AddDoctorInfoToIndex(doctorList); Console.WriteLine(result); Thread.Sleep(2000); //等待索引数据生成 //更新数据 var doctors = searchService.QueryDoctors("55882350"); doctors.ForEach(o=>o.DoctorName="Zery-Zhang"); result = searchService.UpdateDoctorInfoToIndex(doctors); Console.WriteLine(result); //删除数据 //result = searchService.DeleteDoctorInfoToIndex(doctors); //Console.WriteLine(result); Console.Read(); } }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复